var baseurl = 'http://kt.zhangzhengjiang.top/api/';
var static_url = 'http://kt.zhangzhengjiang.top/';
function subPg(){
	// var uid = window.localStorage.getItem('uid');
	// var title = $('#title').val();
	// var content = $('#content').val();
	// var teacher_id  = window.localStorage.getItem('teacher_id');
	// $.ajax({
	// 	url:baseurl+'index/submitPgzuowen',
	// 	type:'post',
	// 	data:{uid:uid,title:title,content:content,teacher_id:teacher_id},
	// 	success:function(res){
			
	// 	}
		
	// });
	if($('#content').val() == ''){
		layer.open({
			content: '请完善信息后进行下一步'
			,skin: 'msg'
			,time: 2 ,//2秒后自动关闭 
		});
		return false;
	}
	window.localStorage.setItem('content',$('#content').val());
	window.location.href="writeMes.html";
}
mrTeacher();
//默认教师
function mrTeacher(){
	var teacher_id  = window.localStorage.getItem('teacher_id');
	$.ajax({
		url:baseurl+'index/getMrTeacher',
		type:'post',
		data:{teacher_id:teacher_id},
		success:function(res){
			window.localStorage.setItem('teacher_id',res.data.id);
			$('#teacher_img').attr('src',static_url+res.data.image);
			$('#teacher_name').html(res.data.name);
			$('#teacher_age').html(res.data.age+'年教龄');
		}
		
	});
}